package com.ck.dao;

import com.ck.model.common.Department;
import com.ck.model.common.dto.DepartmentTreeDTO;
import com.ck.model.common.vo.DepartmentListVO;
import com.ck.model.common.vo.DepartmentSelectListVO;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface DepartmentMapper {
	/**
	 * 保存部门
	 *
	 * @param department
	 */
	void insertDepartment(Department department);

	/**
	 * 修改部门
	 *
	 * @param department Department
	 */
	void updateDepartment(Department department);

	/**
	 * 通过部门ID获取部门
	 *
	 * @param departmentId 部门ID
	 * @return Department
	 */
	Department getDepartmentById(Long departmentId);

	/**
	 * 部门列表
	 *
	 * @param status         状态
	 * @param departmentName 部门名称
	 * @param companyCode    公司编号
	 * @return Page<DepartmentListDTO>
	 */
	Page<DepartmentListVO> listDepartment(@Param("status") Integer status, @Param("departmentName") String departmentName, @Param("companyCode") String companyCode);

	/**
	 * 获取所有启用的部门
	 *
	 * @return List<DepartmentSelectListVO>
	 */
	List<DepartmentSelectListVO> listDepartmentSelect(@Param("companyCode") String companyCode, @Param("status") Integer status);

	/**
	 * 获取部门树列表
	 *
	 * @param companyCode 商家编码
	 * @param status      状态
	 * @return List<DepartmentTreeDTO>
	 */
	List<DepartmentTreeDTO> listDepartmentTree(@Param("companyCode")String companyCode, @Param("status") Integer status);

}